package 代码记录.Bit48天集训;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**编程题已订正
 * 1.完全数计算
 * 2.扑克牌大小
 * @author zx
 * @create 2022-05-12 10:20
 */
public class day_16 {
    /**
     * 自己做出来了
     */
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int res = 0;
        for(int i = 1;i <= n;i++){
            if(isPerfect(i)){
                res++;
            }
        }
        System.out.println(res);
    }
    private static boolean isPerfect(int a){
        List<Integer> list = new ArrayList<>();
        for(int i = 1;i < a;i++){
            if(a % i == 0){
                list.add(i);
            }
        }
        int sum = 0;
        for(int i = 0;i < list.size();i++){
            sum += list.get(i);
        }
        if(sum == a){
            return true;
        }
        return false;
    }

    public static void main3(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String[] str = s.split("-");
        String str1 = str[0];
        String str2 = str[1];
        String[] A = str1.split(" ");
        String[] B = str2.split(" ");
        String p = "34567891JQKA2";
        if(str1.equals("joker JOKER") || str2.equals("joker JOKER")){
            System.out.println("joker JOKER");
        }else if(A.length == B.length){
            if(p.indexOf(A[0].substring(0,1)) > p.indexOf(B[0].substring(0,1))){
                System.out.println(str1.toString());
            }else{
                System.out.println(str2.toString());
            }
        }else if(A.length == 4){
            System.out.println(str1.toString());
        }else if(B.length == 4){
            System.out.println(str2.toString());
        }else{
            System.out.println("ERROR");
        }
    }
}
